//
//  PABaseViewController.m
//  PAMobileWallet
//
//  Created by Pay_SMP002 on 13-7-3.
//  Copyright (c) 2013年 平安付. All rights reserved.
//

#import "PABaseViewController.h"
#import "PAPersonalViewController.h"
@interface PABaseViewController ()

@end

@implementation PABaseViewController
@synthesize parentController;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)back {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)testNext:(id)sender {
    
}

- (void)setTitleName:(NSString *)name {
    self.title = name;
}

- (void)onAction:(id)mself eventType:(int)type arg:(void*)arg {
    
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated {
    [self.navigationController setNavigationBarHidden:YES animated:NO];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    [[NSNotificationCenter defaultCenter] postNotificationName:NOT_ViewDidUnload object:self];
}


- (PAPersonalViewController *)findPersonCenterViewConteroller
{
    UINavigationController *navigationController = (UINavigationController *)[UIApplication sharedApplication].keyWindow.rootViewController;
    NSArray *vcs = navigationController.viewControllers;
    for (PABaseViewController *vc in vcs) {
        if ([vc isKindOfClass:[PAPersonalViewController class]]) {
            return (PAPersonalViewController *)vc;
        }
    }
    return nil;
}
@end
